package org.liufeng.course.util;

import java.util.Date;
import java.util.Calendar; 
import java.text.SimpleDateFormat;

public class NowString {
public static void main(String[] args) { 
	
Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
int year = c.get(Calendar.YEAR); 
int month = c.get(Calendar.MONTH); 
int date = c.get(Calendar.DATE); 
int hour = c.get(Calendar.HOUR_OF_DAY)-1; 
int minute = c.get(Calendar.MINUTE); 
int second = c.get(Calendar.SECOND); 
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
SimpleDateFormat df1 = new SimpleDateFormat("yyyyMMdd");
//System.out.println(year + ""+month +""+  date+"" + hour + "00"); 
//System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
System.out.println(df1.format(new Date())+ hour+"00");// new Date()为获取当前系统时间
}
}